<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>传智健康</title>
    <link rel="stylesheet" href="../css/page-health-index.css"/>
    <link rel="stylesheet" href="../css/page-health-login.css"/>
    <link rel="stylesheet" href="../css/page-health-order.css"/>
    <link rel="stylesheet" href="../plugins/elementui/index.css"/>
    <script src="../plugins/jquery/dist/jquery.min.js"></script>
    <script src="../plugins/jquery/dist/jquery.min.js"></script>
    <script src="../plugins/healthmobile.js"></script>
    <script src="../plugins/datapicker/datePicker.js"></script>
    <script src="../plugins/vue/vue.js"></script>
    <script src="../plugins/vue/axios-0.18.0.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <style>
        .button {
            background-color: #4CAF50; /* Green */
            border: none;
            color: white;
            padding: 5px 32px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            margin-left: 304px;
        }
    </style>
</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div id="app" class="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">传智健康</span>
        <span class="f-right"><i class="icon-more"></i></span>
    </div>
    <!-- 页面内容 -->
    <div class="contentBox">
        <div class="list-column1">
            <ul class="list"
                v-infinite-scroll="load"
                infinite-scroll-disabled="disabled">
                <li class="list-item" v-for="data in dataList">
                    <a class="link-page" :href="'checkrecord_detail.html?id='+data.id+'&oid='+data.oid">
                        <img class="img-object f-left" :src="'http://qgixkwiux.hd-bkt.clouddn.com/'+data.img" alt="">
                        <div class="item-body">
                            <h3 class="ellipsis item-title">体检人:{{data.name}}</h3>
                            <p class="ellipsis-more item-desc">{{data.sname}}</p>
                            <p class="item-keywords">
                                <span>{{data.ssex == '1' ? '男':'女'}}</span>
                                <span>{{data.orderDate}}</span>
                                <span>{{data.orderStatus}}</span>
                            </p>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
<script src="../plugins/vue/vue.js"></script>
<script src="../plugins/vue/axios-0.18.0.js"></script>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            dataList: [],//套餐列表数据
            orderInfo: {
                startDate: '',
                endDate: ''
            }
        },
        mounted() {
            axios.post("/member/findByCookie.do?").then((res) => {
                if (res.data.flag) {
                    axios.post("/member/findSetmealByIdAndDate.do", this.orderInfo).then((res) => {
                        if (res.data.flag) {
                            this.dataList = res.data.data;
                        } else {
                            //this.$message.error(res.data.message);
                            console.log(res.data.message);
                        }
                    });
                } else {
                    //this.$message.error(res.data.message);
                    console.log(res.data.message);
                }
                if(res.data.message == "登录失效"){
                    window.location.href = "/pages/login.html?crlist=true";
                }
            });

        },
        methods: {
            //查询个人预约套餐
            findSetmealByIdAndDate() {
                var startDate = this.orderInfo.startDate;
                var endDate = this.orderInfo.endDate;
                if (startDate == "") {
                    this.$message.error("开始日期不能为空,请检查后重新输入!");
                    return false;
                }
                if (endDate == "") {
                    this.$message.error("结束日期不能为空,请检查后重新输入!");
                    return false;
                }
                axios.post("/member/findSetmealByIdAndDate.do", this.orderInfo).then((res) => {
                    if (res.data.flag) {
                        this.dataList = res.data.data;
                        this.$message.success(res.data.message);
                    } else {
                        this.$message.error(res.data.message);
                    }
                });
            },

            flushPage() {
                this.orderInfo.startDate = null;
                this.orderInfo.endDate = null;
                this.findSetmealByIdAndDate();
            }

        },

    });
</script>
</body>
</html>